#ifndef _TASK_
#define _TASK_
#include <iostream>
#include <string>
#include <functional>
typedef std::function<int(int, int)> func_t;

class Task
{
public:
    Task()
    {
    }
    Task(int x, int y, func_t func) : x_(x), y_(y), func_(func)
    {
    }
    void operator()(std::string name)
    {
        std::cout << "线程：" << name << "处理结束，结果为 " << x_ << " + " << y_ << " = " << func_(x_, y_) << std::endl;
    }

private:
    int x_;
    int y_;
    func_t func_;
};

#endif